import 'package:core/provider/global_key_provider.dart';
import 'package:flutter/material.dart';

class GlobalHelper {
  const GlobalHelper._();

  ///是否debug
  static bool get isDebug => !const bool.fromEnvironment("dart.vm.product");

  /// 关闭软键盘
  static void hideKeyboard() {
    if (null == GlobalKeyProvider.navigatorContext) return;
    FocusScopeNode currentFocus = FocusScope.of(GlobalKeyProvider.navigatorContext!);
    if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) {
      FocusManager.instance.primaryFocus?.unfocus();
    }
  }
}
